package com.spring.demo12.eg1;

import com.spring.demo12.processing.EventListener;
import org.springframework.stereotype.Component;

/**
 * 监听器，负责在用户注册后发送邮箱
 *
 * @author vhans
 */
@Component
public class SendEmailOnUserRegister implements EventListener<UserRegisterSuccessEvent> {
    @Override
    public void onEvent(UserRegisterSuccessEvent event) {
        System.out.printf("给用户「%s」发送邮件\n", event.getUserName());
    }
}
